package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.CountByTime;
import com.zzyl.entity.Visit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author Jun
 */
@Mapper
public interface CustomerReservationMapper {

    /**
     *检查预约是否过期
     */
    void checkAppointmentTime(LocalDateTime now);

    Integer selectCancledReservationCount(@Param("userId") Long userId,@Param("todayStarting") LocalDateTime todayStarting);

    void add(Visit visit);

    Page<Visit> getByPage(@Param("status") Integer status,@Param("userId") Long userId);

    void cancel(@Param("id") Long id,@Param("userId") Long userId);

    List<CountByTime> getCountByTime(LocalDateTime timePar);

    //通过手机号获取预约信息
    List<Visit> getByPhone(String mobile);
}
